package com.example.springblog.mapper;

import com.example.springblog.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserInfoMapper {

    /**
     * 根据用户名，查询用户信息
     * @param userName
     * @return
     */
    @Select("select * from user where delete_flag != 1 and user_name = #{userName}")//这里数据库的操作，采用注解的方式
    UserInfo selectByName(String userName);

    /**
     * 根据用户ID，查询用户信息
     * @param id
     * @return
     */
    @Select("select * from user where delete_flag != 1 and id = #{id}")
    UserInfo selectById(Integer id);




}
